/*
 * @Author: LibraStalker 1299640057@qq.com
 * @Date: 2023-01-27 23:44:52
 * @FilePath: abs.ts
 * @Description: 
 */

/**
 * @file abs op
 * @description abs op 计算绝对值
 */
function mainFunc(
    {},
    {}
) {
    return `
    void main() {
        ivec4 oPos = getOutputTensorPos();
        // 输出坐标转换为输入坐标
        float res = getValueFromTensorPos_origin(oPos.r, oPos.g, oPos.b, oPos.a);
        if (res < float(0)) res = - res;
        setOutput(float(res));
    }
    `;
}
export default {
    mainFunc,
    textureFuncConf: {
        origin: ['getValueFromTensorPos']
    }
};
